package behavior.state;

/**
 * @author dali
 * @date 2021-07-28 15:53
 * @Description
 */

public class Client {
    public static void main(String[] args) throws Exception{
        Context context = new Context();
        context.start();
        context.getCPU();
        context.suspend();
        context.resume();
        context.getCPU();
        context.stop();
        //传统
        Object o = null;
        if (o instanceof InitialState) {
            //新建状态调用
        } else if (o instanceof Runnable) {
            //就绪状态调用
        } else if (o instanceof Running) {
            //运行状态调用
        } else if (o instanceof Blocked) {
            //阻塞状态调用
        }
    }
}
